using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace Zombie.Services.Definitions
{
	public class ZombieSighting : INotifyPropertyChanged
	{
		private string m_AddressLine1;
		private string m_AddressLine2;
		private string m_City;
		private string m_State;
		private string m_ZipCode;
		private string m_ReportersName;
		private string m_EmailAddress;
		private string m_PhoneNumber;
		private int m_ZombieTypeKey;
		private string m_Description;
		private string m_UnformattedAddress;
		private double m_GpsLongitude;
		private double m_GpsLatitude;
		private DateTimeOffset m_SightingDateTime;

		public DateTimeOffset SightingDateTime
		{
			get { return m_SightingDateTime; }
			set
			{
				if (m_SightingDateTime == value)
					return;
				m_SightingDateTime = value;
				OnPropertyChanged();
			}
		}

		public double GpsLatitude
		{
			get { return m_GpsLatitude; }
			set
			{
				if (m_GpsLatitude == value)
					return;
				m_GpsLatitude = value;
				OnPropertyChanged();
			}
		}
		public double GpsLongitude
		{
			get { return m_GpsLongitude; }
			set
			{
				if (m_GpsLongitude == value)
					return;
				m_GpsLongitude = value;
				OnPropertyChanged();
			}
		}
		public string UnformattedAddress
		{
			get { return m_UnformattedAddress; }
			set
			{
				if (m_UnformattedAddress == value)
					return;
				m_UnformattedAddress = value;
				OnPropertyChanged();
			}
		}
		public string AddressLine1
		{
			get { return m_AddressLine1; }
			set
			{
				if (m_AddressLine1 == value)
					return;
				m_AddressLine1 = value;
				OnPropertyChanged();
			}
		}
		public string AddressLine2
		{
			get { return m_AddressLine2; }
			set
			{
				if (m_AddressLine2 == value)
					return;
				m_AddressLine2 = value;
				OnPropertyChanged();
			}
		}
		public string City
		{
			get { return m_City; }
			set
			{
				if (m_City == value)
					return;
				m_City = value;
				OnPropertyChanged();
			}
		}
		public string State
		{
			get { return m_State; }
			set
			{
				if (m_State == value)
					return;
				m_State = value;
				OnPropertyChanged();
			}
		}
		public string ZipCode
		{
			get { return m_ZipCode; }
			set
			{
				if (m_ZipCode == value)
					return;
				m_ZipCode = value;
				OnPropertyChanged();
			}
		}
		public string ReportersName
		{
			get { return m_ReportersName; }
			set
			{
				if (m_ReportersName == value)
					return;
				m_ReportersName = value;
				OnPropertyChanged();
			}
		}
		public string EmailAddress
		{
			get { return m_EmailAddress; }
			set
			{
				if (m_EmailAddress == value)
					return;
				m_EmailAddress = value;
				OnPropertyChanged();
			}
		}
		public string PhoneNumber
		{
			get { return m_PhoneNumber; }
			set
			{
				if (m_PhoneNumber == value)
					return;
				m_PhoneNumber = value;
				OnPropertyChanged();
			}
		}
		public int ZombieTypeKey
		{
			get { return m_ZombieTypeKey; }
			set
			{
				if (m_ZombieTypeKey == value)
					return;
				m_ZombieTypeKey = value;
				OnPropertyChanged();
			}
		}
		public string Description
		{
			get { return m_Description; }
			set
			{
				if (m_Description == value)
					return;
				m_Description = value;
				OnPropertyChanged();
			}
		}

		public event PropertyChangedEventHandler PropertyChanged;

		static readonly Dictionary<string, PropertyChangedEventArgs> s_EventArgs = Helpers.BuildEventArgsDictionary(typeof(ZombieSighting));

		void OnPropertyChanged([CallerMemberName] string propertyName = null)
		{
			OnPropertyChanged(s_EventArgs[propertyName]);
		}

		protected void OnPropertyChanged(PropertyChangedEventArgs eventArgs)
		{
			PropertyChangedEventHandler handler = PropertyChanged;
			if (handler != null)
				handler(this, eventArgs);
		}

	}
}
